package org.neuedu.servlet;

import org.neuedu.bean.reply;
import org.neuedu.service.ReplyService;
import org.neuedu.service.ReplyServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "ForwardDeleteServlet",urlPatterns = "/forward/delete")
public class ForwardDeleteServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id=request.getParameter("id");
        ReplyService replyService =new ReplyServiceImpl();
        replyService.deletecontentById(Integer.valueOf(id));

        request.setAttribute("delete","删除成功");
        request.getRequestDispatcher("/WEB-INF/jsp/user/message.jsp").forward(request,response);
    }
}
